Optimal. Leaf size=123 \[ -\frac {b d^2 n}{x}-\frac {2 b d e n x^{-1+r}}{(1-r)^2}-\frac {b e^2 n x^{-1+2 r}}{(1-2 r)^2}-\frac {d^2 \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {2 d e x^{-1+r} \left (a+b \log \left (c x^n\right )\right )}{1-r}-\frac {e^2 x^{-1+2 r} \left (a+b \log \left (c x^n\right )\right )}{1-2 r} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 123, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {276, 2372, 14}
\begin {gather*} -\frac {d^2 \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {2 d e x^{r-1} \left (a+b \log \left (c x^n\right )\right )}{1-r}-\frac {e^2 x^{2 r-1} \left (a+b \log \left (c x^n\right )\right )}{1-2 r}-\frac {b d^2 n}{x}-\frac {2 b d e n x^{r-1}}{(1-r)^2}-\frac {b e^2 n x^{2 r-1}}{(1-2 r)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 276
Rule 2372
Rubi steps
\begin {align*} \int \frac {\left (d+e x^r\right )^2 \left (a+b \log \left (c x^n\right )\right )}{x^2} \, dx &=-\left (\frac {d^2}{x}+\frac {2 d e x^{-1+r}}{1-r}+\frac {e^2 x^{-1+2 r}}{1-2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \frac {-d^2+\frac {2 d e x^r}{-1+r}+\frac {e^2 x^{2 r}}{-1+2 r}}{x^2} \, dx\\ &=-\left (\frac {d^2}{x}+\frac {2 d e x^{-1+r}}{1-r}+\frac {e^2 x^{-1+2 r}}{1-2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \left (-\frac {d^2}{x^2}+\frac {2 d e x^{-2+r}}{-1+r}+\frac {e^2 x^{2 (-1+r)}}{-1+2 r}\right ) \, dx\\ &=-\frac {b d^2 n}{x}-\frac {2 b d e n x^{-1+r}}{(1-r)^2}-\frac {b e^2 n x^{-1+2 r}}{(1-2 r)^2}-\left (\frac {d^2}{x}+\frac {2 d e x^{-1+r}}{1-r}+\frac {e^2 x^{-1+2 r}}{1-2 r}\right ) \left (a+b \log \left (c x^n\right )\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.17, size = 112, normalized size = 0.91 \begin {gather*} \frac {-b d^2 n \log (x)-d^2 \left (a+b n-b n \log (x)+b \log \left (c x^n\right )\right )+\frac {2 d e x^r \left (-b n+a (-1+r)+b (-1+r) \log \left (c x^n\right )\right )}{(-1+r)^2}+\frac {e^2 x^{2 r} \left (-b n+a (-1+2 r)+b (-1+2 r) \log \left (c x^n\right )\right )}{(1-2 r)^2}}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.22, size = 1927, normalized size = 15.67
method | result | size |
risch | \(\text {Expression too large to display}\) | \(1927\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 411 vs.
\(2 (118) = 236\).
time = 0.37, size = 411, normalized size = 3.34 \begin {gather*} -\frac {4 \, {\left (b d^{2} n + a d^{2}\right )} r^{4} + b d^{2} n - 12 \, {\left (b d^{2} n + a d^{2}\right )} r^{3} + a d^{2} + 13 \, {\left (b d^{2} n + a d^{2}\right )} r^{2} - 6 \, {\left (b d^{2} n + a d^{2}\right )} r - {\left ({\left (2 \, b r^{3} - 5 \, b r^{2} + 4 \, b r - b\right )} e^{2} \log \left (c\right ) + {\left (2 \, b n r^{3} - 5 \, b n r^{2} + 4 \, b n r - b n\right )} e^{2} \log \left (x\right ) + {\left (2 \, a r^{3} - {\left (b n + 5 \, a\right )} r^{2} - b n + 2 \, {\left (b n + 2 \, a\right )} r - a\right )} e^{2}\right )} x^{2 \, r} - 2 \, {\left ({\left (4 \, b d r^{3} - 8 \, b d r^{2} + 5 \, b d r - b d\right )} e \log \left (c\right ) + {\left (4 \, b d n r^{3} - 8 \, b d n r^{2} + 5 \, b d n r - b d n\right )} e \log \left (x\right ) + {\left (4 \, a d r^{3} - b d n - 4 \, {\left (b d n + 2 \, a d\right )} r^{2} - a d + {\left (4 \, b d n + 5 \, a d\right )} r\right )} e\right )} x^{r} + {\left (4 \, b d^{2} r^{4} - 12 \, b d^{2} r^{3} + 13 \, b d^{2} r^{2} - 6 \, b d^{2} r + b d^{2}\right )} \log \left (c\right ) + {\left (4 \, b d^{2} n r^{4} - 12 \, b d^{2} n r^{3} + 13 \, b d^{2} n r^{2} - 6 \, b d^{2} n r + b d^{2} n\right )} \log \left (x\right )}{{\left (4 \, r^{4} - 12 \, r^{3} + 13 \, r^{2} - 6 \, r + 1\right )} x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 10.13, size = 197, normalized size = 1.60 \begin {gather*} - \frac {a d^{2}}{x} + 2 a d e \left (\begin {cases} \frac {x^{r}}{r x - x} & \text {for}\: r \neq 1 \\\log {\left (x \right )} & \text {otherwise} \end {cases}\right ) + a e^{2} \left (\begin {cases} \frac {x^{2 r}}{2 r x - x} & \text {for}\: r \neq \frac {1}{2} \\\log {\left (x \right )} & \text {otherwise} \end {cases}\right ) - \frac {b d^{2} n}{x} - \frac {b d^{2} \log {\left (c x^{n} \right )}}{x} - 2 b d e n \left (\begin {cases} \frac {\begin {cases} \frac {x^{r}}{r x - x} & \text {for}\: r \neq 1 \\\log {\left (x \right )} & \text {otherwise} \end {cases}}{r - 1} & \text {for}\: r > -\infty \wedge r < \infty \wedge r \neq 1 \\\frac {\log {\left (x \right )}^{2}}{2} & \text {otherwise} \end {cases}\right ) + 2 b d e \left (\begin {cases} \frac {x^{r - 1}}{r - 1} & \text {for}\: r \neq 1 \\\log {\left (x \right )} & \text {otherwise} \end {cases}\right ) \log {\left (c x^{n} \right )} - b e^{2} n \left (\begin {cases} \frac {\begin {cases} \frac {x^{2 r}}{2 r x - x} & \text {for}\: r \neq \frac {1}{2} \\\log {\left (x \right )} & \text {otherwise} \end {cases}}{2 r - 1} & \text {for}\: r > -\infty \wedge r < \infty \wedge r \neq \frac {1}{2} \\\frac {\log {\left (x \right )}^{2}}{2} & \text {otherwise} \end {cases}\right ) + b e^{2} \left (\begin {cases} \frac {x^{2 r - 1}}{2 r - 1} & \text {for}\: r \neq \frac {1}{2} \\\log {\left (x \right )} & \text {otherwise} \end {cases}\right ) \log {\left (c x^{n} \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (d+e\,x^r\right )}^2\,\left (a+b\,\ln \left (c\,x^n\right )\right )}{x^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________